package com.java.array;

public class ArrayDemo2 {
    public static void main(String[] args) {
        //定义数组
        String[] names = {"曹操","刘备","孙权","赵云","张辽"};
/*        //常规的for
        for (int i = 0; i < names.length; i++) {
            System.out.println("英雄名字 " + names[i]);
        }*/

        //foreach循环
        for (String name:names){
            System.out.println("姓名："+ name);
        }
    }
}
